/*
 * @Author: yangfan 1437446666@qq.com
 * @Date: 2023-02-28 10:32:10
 * @LastEditors: yangfan 1437446666@qq.com
 * @LastEditTime: 2023-03-08 15:30:46
 * @FilePath: \s_2006A_shixun\src\api\knowledge.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { getHttp, deleteHttp, postHttp, putHttp } from '../utils/http'
import { GETHttp, POSTHttp, DELEeteHttp, PATCHHttp } from '../utils/https'

//获取知识小册列表
export const getKnowledge = async (params) => {
  return await getHttp('/api/get_knowledge', params)
}

//网络接口获取知识小册
export const GETKnowledge = async (params) => {
  return await GETHttp('/api/knowledge', params)
}
// 网络接口删除
export const DEleteHttp = async (params) => {
  return await DELEeteHttp(`/api/knowledge/${params}`)
}

//网络接口修改小册列表
export const PATCHKowledge = async (id, params) => {
  return await PATCHHttp('/api/knowledge/' + id, params)
}
//修改小册列表
export const setKnowledge = async (params) => {
  return await postHttp('/api/set_knowledge', params)
}
//新建小册列表
export const newKnowledge = async (params) => {
  return await POSTHttp('/api/knowledge/book', params)
}
//编辑小册列表
export const editKnowledge = async (params) => {
  return await postHttp('/api/edit_knowledge', params)
}
//回显小册列表
export const echoKnowledge = async (params) => {
  return await GETHttp(`/api/Knowledge/${params}`)
}
//新建知识小册章节
export const newSection = async (params) => {
  return await putHttp('/api/new_Section', params)
}
//获取知识小册章节
export const getSection = async (params) => {
  return await getHttp('/api/get_Section', params)
}
